/*
 * @des: 所有页面路由
 * @author: yyq
 * @Date: 201-01-05
*/


/* 公用模块/页面
---------------------------------------------------------------- */
// 404页面
const notFound = r => require.ensure([], () => r(require('@/components/notFound')), 'notFound')
// 布局容器
const container = r => require.ensure([], () => r(require('@/components/container')), 'container')
// 页面模块容器
const pageContainer = r => require.ensure([], () => r(require('@/page/pageContainer')), 'pageContainer')


/* 总体概况
---------------------------------------------------------------- */
// 首页-完整版
const index = r => require.ensure([], () => r(require('@/page/home/index')), 'index')
// 首页-精简版
const simple = r => require.ensure([], () => r(require('@/page/home/simple')), 'simple')
// 登录页
const login = r => require.ensure([], () => r(require('@/page/home/login')), 'login')


/* 认证管理模块
---------------------------------------------------------------- */
// 用户分组-用户组管理
const userGroupManage = r => require.ensure([], () => r(require('@/page/authManage/userGroupManage')), 'userGroupManage')
// 用户分组-用户管理
const userManage = r => require.ensure([], () => r(require('@/page/authManage/userManage')), 'userManage')


export default [
	// 404页面
	{
		path: '*',
		name: 'notFound',
		component: notFound
	},
	// 登陆页
	{
		path: '/login',
		name: 'login',
		component: login
	},
	{
		path: '/',
		redirect: '/home/index',
		component: container,
		children: [
			// 总体概况
			{
				path: '/home',
				component: pageContainer,
				children: [
					{
						path: '',
						redirect: '/home/index',
						component: index
					},
					// 总体概况-完整版
					{
						path: 'index',
						name: 'index',
						component: index
					},
					// 总体概况-精简版
					{
						path: 'simple',
						name: 'simple',
						component: simple
					}
				]
			},
			// 认证管理模块
			{
				path: '/auth',
				component: pageContainer,
				children: [
					{
						path: '',
						redirect: '/auth/userGroupManage',
						component: userGroupManage
					},
					// 用户分组-用户组管理
					{
						path: 'userGroupManage',
						name: 'userGroupManage',
						component: userGroupManage
					},
					// 用户分组-用户管理
					{
						path: 'userManage',
						name: 'userManage',
						component: userManage
					}
				]
			}
		]
	}
]
